import java.util.Scanner;


public class Test {
    //查找输入整数二进制中1的个数
    import java.util.*;
    public class Main{
        public static void main(String[]args){
            Scanner sc=new Scanner(System.in);
            while(sc.hasNext()){
                int n=sc.nextInt();
                int count=0;
                while(n!=0){
                    if((n&1)==1){
                        count++;
                    }
                    n>>=1;
                }
                System.out.println(count);
            }
        }
    }
}
